<template>
  <div>
    <!-- 遮罩 -->
    <div
      ref="mask"
      id="mask"
      v-loading="show"
      element-loading-text="拼命加载中"
      element-loading-spinner="el-icon-loading"
      element-loading-background="rgba(0, 0, 0, 0.5)"
      v-if="show"
    ></div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      show: false,
    };
  },
  created() {
    this.$bus.$on("show", (data) => {
      this.show = data;
    });
  },
};
</script>

<style lang="less" scoped>
/* 遮罩 */
#mask {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
}
</style>